

#ifndef THREAD_SEARCH_LOGGER_TREE_H
#define THREAD_SEARCH_LOGGER_TREE_H

#include <wx/event.h>

#include "ThreadSearchLoggerBase.h"

class wxString;
class wxWindow;
class wxPanel;
class wxTreeCtrl;
class wxTreeEvent;

class ThreadSearch;
class ThreadSearchView;
class sThreadSearchEvent;



class ThreadSearchLoggerTree : public wxEvtHandler, public ThreadSearchLoggerBase
{
public:
	
	ThreadSearchLoggerTree(ThreadSearchView& threadSearchView, ThreadSearch& threadSearchPlugin,
							InsertIndexManager::eFileSorting fileSorting, wxPanel* pParent, long id);

	
	virtual ~ThreadSearchLoggerTree();

	
	virtual eLoggerTypes GetLoggerType() {return TypeTree;}

	
	virtual void OnThreadSearchEvent(const sThreadSearchEvent& event);

	
	virtual void Clear();

	
	virtual wxWindow* GetWindow();

	
	virtual void SetFocus();

	
    void OnLoggerTreeClick(wxTreeEvent& event);

	
    void OnLoggerTreeDoubleClick(wxTreeEvent& event);

    void SyncLoggerToPreview();


protected:
	
	bool GetFileLineFromTreeEvent(wxTreeEvent& event, wxString& filepath, long &line);

	
	virtual void ConnectEvents(wxEvtHandler* pEvtHandler);

	
	virtual void DisconnectEvents(wxEvtHandler* pEvtHandler);

    void OnMouseWheelEvent(wxMouseEvent& event);


	wxTreeCtrl* m_pTreeLog;
	bool        m_FirstItemProcessed; // Used to filter wxTree events and process useful ones only.
};

#endif // THREAD_SEARCH_LOGGER_TREE_H
